package com.zzzzzz;

import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class GetBean {
	private static String[] locations = {"classpath*:/root-context.xml"};
	private static AbstractApplicationContext ctx =null;
	
	public static Object getBean(String serviceName){
		if(ctx == null)	ctx= new ClassPathXmlApplicationContext(locations);
		return ctx.getBean(serviceName);
	}
}
